﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace TKToXML
{
    public class HuyKhaiBao : BaseChungTu
    {     
        /// <summary>
        /// Số tiếp nhận
        /// </summary>
        public int CustomsReference { get; set; }
        /// <summary>
        /// Ngày nhận được số tiếp nhận
        /// </summary>
        public DateTime NgayNhanSoTiepNhan { get; set; }
        /// <summary>
        /// Mã hủy
        /// </summary>
        public int Statement { get; set; }
        /// <summary>
        /// Lý do hủy
        /// </summary>
        public string Content { get; set; }
        
        public string ToXML()
        {
            string result = "<Declaration>";            
                result += "<issuer>" + Type.ToString() + "</issuer>";
                result += "<reference>" + Reference + "</reference>";
                result += "<issue>" + IssueDate.ToString("yyyy-MM-dd HH:mm:ss") + "</issue>";//2010-08-17 16:40:00
                result += "<function>" + (int)MessageFuntion.KhaiBao + "</function>"; 
                //Nơi khai báo xin hủy, không bắt buộc khai
                //result += "<issueLocation>" + "" + "</issueLocation>";
                //So tiep nhan
                result += "<customsReference>" + CustomsReference.ToString() + "</customsReference>"; 
                //Ngay nhan duoc so tiep nhan
                result += "<acceptance>" + NgayNhanSoTiepNhan.ToString("yyyy-MM-dd HH:mm:ss") + "</acceptance>";                
                result += "<declarationOffice>" + MaHQ +"</declarationOffice>";
             
                result += "<AdditionalInformation>";
                    result += "<statement>" + Statement.ToString() + "</statement>"; 
                    result += "<content>" + Content + "</content>";                    
                result += "</AdditionalInformation>";

            result += "</Declaration>";            

            return result;
        }
    }
}
